package com.bestow.basic.service.impl;

import java.util.List;
import com.bestow.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bestow.basic.mapper.FndCodingRulesMapper;
import com.bestow.basic.domain.FndCodingRules;
import com.bestow.basic.service.IFndCodingRulesService;

/**
 * 编码规则Service业务层处理
 * 
 * @author liliu
 * @date 2022-09-03
 */
@Service
public class FndCodingRulesServiceImpl implements IFndCodingRulesService 
{
    @Autowired
    private FndCodingRulesMapper fndCodingRulesMapper;

    /**
     * 查询编码规则
     * 
     * @param codingRuleId 编码规则主键
     * @return 编码规则
     */
    @Override
    public FndCodingRules selectFndCodingRulesByCodingRuleId(Long codingRuleId)
    {
        return fndCodingRulesMapper.selectFndCodingRulesByCodingRuleId(codingRuleId);
    }

    /**
     * 查询编码规则列表
     * 
     * @param fndCodingRules 编码规则
     * @return 编码规则
     */
    @Override
    public List<FndCodingRules> selectFndCodingRulesList(FndCodingRules fndCodingRules)
    {
        return fndCodingRulesMapper.selectFndCodingRulesList(fndCodingRules);
    }

    /**
     * 新增编码规则
     * 
     * @param fndCodingRules 编码规则
     * @return 结果
     */
    @Override
    public int insertFndCodingRules(FndCodingRules fndCodingRules)
    {
        fndCodingRules.setCreateTime(DateUtils.getNowDate());
        return fndCodingRulesMapper.insertFndCodingRules(fndCodingRules);
    }

    /**
     * 修改编码规则
     * 
     * @param fndCodingRules 编码规则
     * @return 结果
     */
    @Override
    public int updateFndCodingRules(FndCodingRules fndCodingRules)
    {
        fndCodingRules.setUpdateTime(DateUtils.getNowDate());
        return fndCodingRulesMapper.updateFndCodingRules(fndCodingRules);
    }

    /**
     * 批量删除编码规则
     * 
     * @param codingRuleIds 需要删除的编码规则主键
     * @return 结果
     */
    @Override
    public int deleteFndCodingRulesByCodingRuleIds(Long[] codingRuleIds)
    {
        return fndCodingRulesMapper.deleteFndCodingRulesByCodingRuleIds(codingRuleIds);
    }

    /**
     * 删除编码规则信息
     * 
     * @param codingRuleId 编码规则主键
     * @return 结果
     */
    @Override
    public int deleteFndCodingRulesByCodingRuleId(Long codingRuleId)
    {
        return fndCodingRulesMapper.deleteFndCodingRulesByCodingRuleId(codingRuleId);
    }
}
